import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { Product } from "./product.entity";
@Entity("t_v2_mold_info")
export class Mold {
  @PrimaryGeneratedColumn({ type: "bigint" })
  id: string;

  @Column("varchar", { name: "tenant_id", length: 30 })
  tenantId: string;

  @Column("varchar", { name: "mold_no", comment: "模具编号", length: 50 })
  moldNo: string;

  @Column("varchar", {
    name: "mold_name",
    nullable: true,
    comment: "模具名称",
    length: 50,
  })
  moldName: string | null;

  @Column("varchar", {
    name: "mold_size",
    nullable: true,
    comment: "模具尺寸",
    length: 30,
  })
  moldSize: string | null;

  @Column("char", { name: "del_flag", length: 1, default: () => "'0'" })
  delFlag: string;

  @Column("bigint", { name: "create_by" })
  createBy: string;

  @Column("datetime", { name: "create_time" })
  createTime: Date;

  @Column("bigint", { name: "update_by" })
  updateBy: string;

  @Column("datetime", { name: "update_time" })
  updateTime: Date;

  @Column("char", {
    name: "mold_source",
    comment: "模具录入来源 1：项目计划 2：模具一览表",
    length: 1,
    default: () => "'1'",
  })
  moldSource: string;

  @Column("bigint", {
    name: "project_manager_user",
    nullable: true,
    comment: "项目经理",
  })
  projectManagerUser: string | null;

  @Column("bigint", {
    name: "design_user",
    nullable: true,
    comment: "设计负责人",
  })
  designUser: string | null;

  @Column("bigint", {
    name: "fitter_user",
    nullable: true,
    comment: "钳工负责id",
  })
  fitterUser: string | null;

  @Column("tinyint", {
    name: "fitter_type",
    comment: "钳工负责类型（0：未定义 1：人员, 2部门）",
    unsigned: true,
    default: () => "'0'",
  })
  fitterType: number;

  @Column("bigint", {
    name: "mold_picture",
    nullable: true,
    comment: "模具照片OSSID",
  })
  moldPicture: string | null;

  @Column("bigint", {
    name: "product_image_id",
    comment: "产品拼接图ossId",
    default: () => "'0'",
  })
  productImageId: string | null;

  @Column("bigint", { name: "image_id", comment: "主图", default: () => "'0'" })
  imageId: string;

  products: Product[];
}